<?php if (!defined('THINK_PATH')) exit();?><div class="bjui-pageHeader">
    <div class="pull-right">
        <button class="btn-default" data-icon="refresh" onclick="$.CurrentNavtab.navtab('refresh')"></button>
    </div>
    <form id="pagerForm" data-toggle="ajaxsearch" data-loadingmask="true" action="<?php echo U('returned');?>" method="post">
        <input type="hidden" name="pageSize" value="<?php echo I('param.pageSize');?>" />
        <input type="hidden" name="pageCurrent" value="<?php echo I('param.pageCurrent');?>" />
        <input type="hidden" name="orderField" value="<?php echo I('param.orderField');?>" />
        <input type="hidden" name="orderDirection" value="<?php echo I('param.orderDirection');?>" />
        <div class="bjui-searchBar">
            <label>状态:</label>
            <select name="pay_status" data-toggle="selectpicker">
                <option value="">--请选择--</option>
                <option value="0" <?php if(I('pay_status') == '0'): ?>selected<?php endif; ?>>未处理</option>
                <option value="1" <?php if(I('pay_status') == '1'): ?>selected<?php endif; ?>>处理失败</option>
                <option value="2" <?php if(I('pay_status') == '2'): ?>selected<?php endif; ?>>处理通过</option>
            </select>
            <label>订单号:</label>
            <input type="text" name="order_no" value="<?php echo I('order_no');?>"/>
            <label>时间区间:</label>
            <input type="text" name="start_time" class="dateStart"  data-toggle="datepicker" style="width: 150px;" value="<?php echo I('start_time');?>"/>
            -
            <input type="text" name="end_time" class="dateEnd" data-toggle="datepicker"  style="width: 150px;" value="<?php echo I('end_time');?>"/>
            <button type="submit" class="btn-default" data-icon="search">查询</button>
            <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">清空查询 </a>
        </div>
    </form>
</div>
<div class="bjui-pageContent tableContent">
    <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="false">
        <thead>
        <tr>
            <th>订单号</th>
            <th>申请用户名</th>
            <th>退款金额</th>
            <th>退款原因</th>
            <th>申请时间</th>
            <th>状态</th>
            <th width="100">操作</th>
        </tr>
        </thead>
        <tbody>
        <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
            <td><a href="javascript:void(0)" onclick="createDialog('<?php echo U("Order/msg",array("id"=>$vo["id"]));?>', '订单详细-<?php echo ($vo["order_no"]); ?>', 'ordermsg', {width:800, height:500})"><?php echo ($vo["order_no"]); ?></a></td>
            <td><?php echo ($vo['name']?$vo['name']:$vo['mobile']); ?></td>
            <td><?php echo ($vo["amount"]); ?></td>
            <td><?php echo ($vo["reason"]); ?></td>
            <td><?php echo ($vo["time"]); ?></td>
            <td>
                <?php if($vo["pay_status"] == '0'): ?><span class="text-danger">未处理</span>
                <?php elseif($vo["pay_status"] == '1'): ?>
                  <p>审核失败</p>
                  <p>处理人：<?php echo ($vo["adminname"]); ?></p>
                  <p>处理时间：<?php echo ($vo["dispose_time"]); ?></p>
                  <p>备注:<?php echo ($vo["dispose_idea"]); ?></p>
                <?php else: ?>
                  <p> 已处理</p>
                  <p>处理人：<?php echo ($vo["adminname"]); ?></p>
                  <p>处理时间：<?php echo ($vo["dispose_time"]); ?></p>
                  <p>备注:<?php echo ($vo["dispose_idea"]); ?></p><?php endif; ?>
                </td>
            <td>
                <button type="button" class="btn-green" onclick="createDialog('<?php echo U("Order/msgthree",array("id"=>$vo["id"]));?>', '退款详细', 'returned', {width:700, height:500})">详</button>
               <!--  <a href="<?php echo U('Order/del_refund',array('id'=>$vo['id']));?>" class="btn btn-red"  data-type="get" data-toggle="doajax" data-confirm-msg="你确定要删除吗？删除之后就不能恢复啦" >删</a> -->
            </td>
        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
</div>

<div class="bjui-pageFooter">
		
	<?php if(page == save): ?><ul>
			<li><button type="submit" class="btn-default" data-icon="save">保存</button></li>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
	<?php elseif(page == close): ?>
	    <ul>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
	<?php elseif(page == page and $show != null): ?>
		<ul>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
		    <div class="pages">
		        <span>每页&nbsp;</span>
		        <div class="selectPagesize">
		            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
		                <option value="<?php echo ($show['listrow']); ?>"><?php echo ($show['listrow']); ?></option>
		                <option value="60">60</option>
		                <option value="120">120</option>
		                <option value="150">150</option>
		            </select>
		        </div>
		        <span>&nbsp;条，共 <?php echo ($show['total']); ?> 条</span>
		    </div>
		    <div class="pagination-box" data-toggle="pagination" data-total="<?php echo ($show['total']); ?>" data-page-size="<?php echo ($show['listrow']); ?>" data-page-current="1">
		    </div>
	<?php elseif(page == page and $show == null): ?>
		<ul>
			<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
		</ul>
	<?php else: ?>
		<ul>
			<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
		</ul><?php endif; ?>

</div>